﻿
namespace SilverlightHVP.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;


    [EnableClientAccess()]
    public class HVPConfigRIAService : LinqToEntitiesDomainService<YZF265_HVPEntities>
    {

        public IQueryable<Item> GetItems()
        {
            return this.ObjectContext.Items;
        }

        public IQueryable<ItemsView> GetItemsViews(int setID)
        {
            return this.ObjectContext.ItemsViews.Where(e => e.MySetID == setID);
        }

        public IQueryable<Link> GetLinks()
        {
            return this.ObjectContext.Links;
        }

        public IQueryable<LinksView> GetLinksViews(int itemID)
        {
            return this.ObjectContext.LinksViews.Where(e => e.MyItem == itemID).OrderBy(e => e.Offset);
        }

        public IQueryable<Listable> GetListables()
        {
            return this.ObjectContext.Listables;
        }

        public IQueryable<Set> GetSets()
        {
            return this.ObjectContext.Sets;
        }

        public IQueryable<SetsView> GetSetsViews()
        {
            return this.ObjectContext.SetsViews;
        }

        public IQueryable<Topic> GetTopics()
        {
            return this.ObjectContext.Topics;
        }

        public IQueryable<TopicsView> GetTopicsViews(int itemID)
        {
            return this.ObjectContext.TopicsViews.Where(e => e.MyItem == itemID).OrderBy(e => e.Offset);
        }
    }
}


